var orderdb = require('../../db/order.db');
var emit = require('../../emit');

function onsocket(socket,data){       
    orderdb.removeorderitem(socket.handshake.cookies.authorized, data.orderid,function(err){            
        if(err){
            emit.send(socket,'removeorderitem', 0);
        }else{
            emit.send(socket,'removeorderitem', 1);
        }    
    });       
}

module.exports = {
    onsocket
}